<?php

class taskmgr_whitelist{

    //进队列业务逻辑处理任务
    static public function task_list(){
        return $_tasks = array(
            'autochk'      => array('method'=>'wms_autotask_task_check', 'threadNum'=>5),
            'autodly'      => array('method'=>'wms_autotask_task_consign', 'threadNum'=>5),
            'autochkanddly'=> array('method'=>'wms_autotask_task_checkandconsign', 'threadNum'=>5),
            'autodlycomp'=> array('method'=>'wms_autotask_task_syncoms', 'threadNum'=>5),
            'autorder'     => array('method'=>'ome_autotask_task_combine', 'threadNum'=>5),#自动审单 ExBOY
            'autoretryapi' => array('method'=>'erpapi_autotask_task_retryapi', 'threadNum'=>5),
            'autowapdly' => array('method'=>'o2o_autotask_task_statistic', 'threadNum'=>1),#wap统计发货单数据
        );
    }

    //定时任务，线程数不允许修改
    static public function timer_list(){
        return $_tasks = array(
            //'bgqueue' => array('method'=>'ome_autotask_timer_bgqueue', 'threadNum'=>1),
            //'misctask' => array('method'=>'ome_autotask_timer_misctask', 'threadNum'=>1),
            'inventorydepth' => array('method'=>'ome_autotask_timer_inventorydepth', 'threadNum'=>1),
            'financecronjob' => array('method'=>'ome_autotask_timer_financecronjob', 'threadNum'=>1),
            'batchfill' => array('method'=>'ome_autotask_timer_batchfill', 'threadNum'=>1),
            'cleandata' => array('method'=>'ome_autotask_timer_cleandata', 'threadNum'=>1),
            'hour' =>  array('method'=>'ome_autotask_timer_hour', 'threadNum'=>1),
            'cancelorder' =>  array('method'=>'ome_autotask_timer_cancelorder', 'threadNum'=>1),
            'ordersprice' =>  array('method'=>'ome_autotask_timer_ordersprice', 'threadNum'=>1),
            'orderstime' =>  array('method'=>'ome_autotask_timer_orderstime', 'threadNum'=>1),
            'rmatype' =>  array('method'=>'ome_autotask_timer_rmatype', 'threadNum'=>1),
            'sale' =>  array('method'=>'ome_autotask_timer_sale', 'threadNum'=>1),
            //'catsalestatis' =>  array('method'=>'ome_autotask_timer_catsalestatis', 'threadNum'=>1),//两个统计报表已废弃
            //'productsalerank' =>  array('method'=>'ome_autotask_timer_productsalerank', 'threadNum'=>1),
            'storestatus' =>  array('method'=>'ome_autotask_timer_storestatus', 'threadNum'=>1),
            'stockcost' =>  array('method'=>'ome_autotask_timer_stockcost', 'threadNum'=>1),
            'logistestimate' =>  array('method'=>'ome_autotask_timer_logistestimate', 'threadNum'=>1),
            'queue' => array('method'=>'ome_autotask_timer_queue', 'threadNum'=>1),
            'stocknsale' => array('method'=>'ome_autotask_timer_stocknsale', 'threadNum'=>1),
            'productnsale' => array('method'=>'ome_autotask_timer_productnsale', 'threadNum'=>1),
            'storedaliy' => array('method'=>'o2o_autotask_timer_storedaliy', 'threadNum'=>1),
            //add by ldward 自动备份订单数据
            'autobackuporder' => array('method'=>'archive_autotask_timer_autobackuporder', 'threadNum'=>1),
        );
    }

    //初始化域名进任务队列,这里的命名规范就是实际连的队列任务+domainqueue生成这个初始化任务的数组值，线程数不允许修改
    static public function init_list(){
        return $_tasks = array(
            //'bgqueuedomainqueue' => array('threadNum'=>1),
            //'misctaskdomainqueue' => array('threadNum'=>1),
            'inventorydepthdomainqueue' => array('threadNum'=>1),
            'financecronjobdomainqueue' => array('threadNum'=>1),
            'batchfilldomainqueue' => array('threadNum'=>1),
            'cleandatadomainqueue' => array('threadNum'=>1),
            'hourdomainqueue' => array('threadNum'=>1),
            'cancelorderdomainqueue' => array('threadNum'=>1),
            'orderspricedomainqueue' => array('threadNum'=>1),
            'orderstimedomainqueue' => array('threadNum'=>1),
            'rmatypedomainqueue' => array('threadNum'=>1),
            'saledomainqueue' => array('threadNum'=>1),
            'catsalestatisdomainqueue' => array('threadNum'=>1),
            'productsalerankdomainqueue' => array('threadNum'=>1),
            'storestatusdomainqueue' => array('threadNum'=>1),
            'stockcostdomainqueue' => array('threadNum'=>1),
            'logistestimatedomainqueue' => array('threadNum'=>1),
            'stocknsaledomainqueue' => array('threadNum'=>1),
            'productnsaledomainqueue' => array('threadNum'=>1),
            'storedaliydomainqueue' => array('threadNum'=>1),
            'autobackuporderdomainqueue' => array('threadNum'=>1),
        );
    }

    //导出任务
    static public function export_list(){
        return $_tasks = array(
            'exportsplit' => array('method'=>'ome_autotask_export_exportsplit', 'threadNum'=>10),
            'dataquerybysheet' => array('method'=>'ome_autotask_export_dataquerybysheet', 'threadNum'=>10),
            'dataquerybyquicksheet' => array('method'=>'ome_autotask_export_dataquerybyquicksheet', 'threadNum'=>10),
            'dataquerybywhole' => array('method'=>'ome_autotask_export_dataquerybywhole', 'threadNum'=>10),
            'createfile' => array('method'=>'ome_autotask_export_createfile', 'threadNum'=>10),
        );
    }

    //rpc任务
    static public function rpc_list(){
        return $_tasks = array(
            'omecallback' => array('method'=>'ome_autotask_rpc_omecallback', 'threadNum'=>5),
            'wmscallback' => array('method'=>'ome_autotask_rpc_wmscallback', 'threadNum'=>5),
            'wmsrpc' => array('method'=>'ome_autotask_rpc_wmsrpc', 'threadNum'=>5),
            'orderrpc' => array('method'=>'ome_autotask_rpc_orderrpc', 'threadNum'=>5),
        );
    }

    //全部任务
    static public function get_all_task_list(){
        return array_merge(self::task_list(),self::timer_list(),self::export_list(),self::rpc_list());
    }

    static public function get_task_types(){
    	return array('task','timer','init','export','rpc');
    } 
}
